package com.kgajowy.result;

import edu.pjwstk.jps.interpreter.qres.IQResStack;
import edu.pjwstk.jps.result.IAbstractQueryResult;

import java.util.LinkedList;

public class QResStack implements IQResStack {

    LinkedList<IAbstractQueryResult> stack;
    
    public QResStack() {
        this.stack = new LinkedList<IAbstractQueryResult>();
    }
    
    @Override
    public IAbstractQueryResult pop() {
        if ( this.stack.size() > 0 ) {
            return this.stack.pop();
        } else {
            return null;
        }
    }

    @Override
    public void push(IAbstractQueryResult value) {
        this.stack.push(value);
    }

}
